home *** CD-ROM | disk | FTP | other *** search
- package org.flintparticles.particles
- {
- import flash.display.DisplayObject;
- import flash.geom.ColorTransform;
- import flash.geom.Matrix;
- import flash.utils.Dictionary;
-
- public class Particle
- {
-
-
- private var _dictionary:Dictionary = null;
-
- public var rotation:Number = 0;
-
- public var energy:Number = 1;
-
- public var lifetime:Number = 0;
-
- public var scale:Number = 1;
-
- public var angVelocity:Number = 0;
-
- public var image:DisplayObject = null;
-
- public var velY:Number = 0;
-
- public var velX:Number = 0;
-
- public var color:uint = 4294967295;
-
- public var spaceSortX:uint;
-
- public var isDead:Boolean = false;
-
- public var x:Number = 0;
-
- public var y:Number = 0;
-
- public var age:Number = 0;
-
- public function Particle()
- {
- x = 0;
- y = 0;
- velX = 0;
- velY = 0;
- rotation = 0;
- angVelocity = 0;
- color = 4294967295;
- scale = 1;
- image = null;
- lifetime = 0;
- age = 0;
- energy = 1;
- isDead = false;
- _dictionary = null;
- super();
- }
-
- public function get dictionary() : Dictionary
- {
- if(_dictionary == null)
- {
- _dictionary = new Dictionary();
- }
- return _dictionary;
- }
-
- public function get colorTransform() : ColorTransform
- {
- return new ColorTransform((color >>> 16 & 255) / 255,(color >>> 8 & 255) / 255,(color & 255) / 255,(color >>> 24 & 255) / 255,0,0,0,0);
- }
-
- public function initialize() : void
- {
- x = 0;
- y = 0;
- velX = 0;
- velY = 0;
- rotation = 0;
- angVelocity = 0;
- color = 4294967295;
- scale = 1;
- lifetime = 0;
- age = 0;
- energy = 1;
- isDead = false;
- image = null;
- spaceSortX = 0;
- _dictionary = null;
- }
-
- public function get matrixTransform() : Matrix
- {
- var _loc1_:Number = NaN;
- var _loc2_:Number = NaN;
- _loc1_ = scale * Math.cos(rotation);
- _loc2_ = scale * Math.sin(rotation);
- return new Matrix(_loc1_,_loc2_,-_loc2_,_loc1_,x,y);
- }
- }
- }
-